// 加载层
var loadIndex = layer.load(1, { shade: [0.5, '#fff'] })
    // 定义一个async异步函数
async function getOppo() {
    var oppo = document.querySelector('.oppo .con aside');
    var oppo_list = await pAjax({
        url: '../server/oppo.php',
        data: { pid: 4 }
    });
    var { data } = oppo_list;
    var str = '';
    str = ` <img src="${data[0].imgpath}" alt="">`
    for (var i = 1; i < data.length; i++) {
        str += `
            <div class="title">
            <img src="${data[i].imgpath_litte}" alt="">
            <p>${data[i].name}</p>
            <li><i>${data[i].i}</i><b>${data[i].b}</b></li>
            <span>￥${data[i].price}<s>${data[i].s}</s></span>
        </div>`
    }
    oppo.innerHTML = str;
    // *******************************************
    // onePuls
    var onePlus = document.querySelector('.onePlus .con aside');
    var onePlus_list = await pAjax({
        url: '../server/oppo.php',
        data: { pid: 5 }
    });
    var { data } = onePlus_list;
    var str1 = '';
    str1 = ` <img src="${data[0].imgpath}" alt="">`
    for (var i = 1; i < data.length; i++) {
        str1 += `
            <div class="title">
            <img src="${data[i].imgpath_litte}" alt="">
            <p>${data[i].name}</p>
            <li><b>${data[i].b}</b></li>
            <span>￥${data[i].price}<s>${data[i].s}</s></span>
        </div>`
    }
    onePlus.innerHTML = str1;
    // ********************************************
    //潮流好物
    var tide = document.querySelector('.tide .con aside');
    var tide_list = await pAjax({
        url: '../server/oppo.php',
        data: { pid: 6 }
    });
    var { data } = tide_list;
    var str2 = '';
    str2 = `<div class="live"></div>`
    data.forEach((item, index, arr) => {
        str2 += `
        <div class="title">
        <img src="${item.imgpath_litte}" alt="">
        <p>${item.name}</p>
        <li><b>${item.b}</b></li>
        <span>￥${item.price}</span>
    </div>`
    });
    tide.innerHTML = str2;
}
layer.close(loadIndex)

getOppo()